#include <QtWidgets/QApplication>
#include <QSplashScreen>
#include <QElapsedTimer>
#include <QTranslator>
#include "mainframe/mainwindow.h"

int main(int argc, char *argv[])
{
	QApplication a(argc, argv);
    QCoreApplication::setApplicationName("Radiomics Station");
    QCoreApplication::setOrganizationName("JiuFeng Medical");
    QCoreApplication::setOrganizationDomain("www.jfhealthcare.com");

    QTranslator t;
    t.load("radiomicstation_cn.qm");
    a.installTranslator(&t);

	//start flash
    QSplashScreen *splash = new QSplashScreen(QPixmap(":/splash/radiomics.png"));
    splash->show();
	Qt::Alignment topRight = Qt::AlignRight | Qt::AlignTop;
    splash->showMessage(QObject::tr("radiomics loading..."),topRight,Qt::red);
    QElapsedTimer *et = new QElapsedTimer;
    et->start();
    while (et->elapsed()<2000)
	{
		QCoreApplication::processEvents();
	}
    delete et;

    MainWindow w;
    w.showMaximized();
    splash->finish(&w);
    delete splash;

	return a.exec();
}
